package com.ekalenchuk.module.controllers;

import java.io.Serializable;

import org.springframework.beans.factory.annotation.Autowired;

import com.ekalenchuk.module.dto.session.UserSession;
import com.ekalenchuk.module.service.user.UserService;

public class BaseController implements Serializable{

	private static final long serialVersionUID = -5202268486501033438L;

	@Autowired
	private UserSession userSession;
	
	@Autowired
	private UserService userService;
	
	public UserSession getUserSession() {
		return userSession;
	}

	public void setUserSession(UserSession userSession) {
		this.userSession = userSession;
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	public boolean isLoggedIn(){
		return userSession == null ? false : userSession.isLoggedIn();
	}
}
